//
//  DownLoad.h
//  downdemo
//
//  Created by 陶秋安 on 16/3/3.
//  Copyright © 2016年 孙智慧. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "ZYMusic.h"

@protocol DownloadDelegate <NSObject>

@optional

/**
 *  点击按钮
 */
- (void) setProgess:(CGFloat) currValue;

@end

@protocol DownloadDelDelegate <NSObject>

@optional

/**
 *  点击按钮
 */
- (void) del:(id) obj;

@end

@interface DownLoad : NSObject<NSURLSessionDelegate>
{
    id<DownloadDelegate> _delegate;
    
    id<DownloadDelDelegate> _delDelegate;
    
    NSURLSessionDownloadTask * _task;
    
    NSData * _data;
    
    NSURLSession * _session;
    
    NSURLRequest * _request;
 
    NSString *_fileURL;
    
    NSString *_storePath;
    
    @public ZYMusic *zyMusic;
}

- (void) setDel:( id<DownloadDelegate>)delegate;
- (void) setDeleteDel:( id<DownloadDelDelegate>)delegate;
- (id)init:(NSString *)fileURL andStorePath:(NSString *)storePath;
- (void) ddLoad;
- (void) pause;
- (void) resume;

@end
